home *** CD-ROM | disk | FTP | other *** search
- Path: ix.netcom.com!news
- From: miker3@ix.netcom.com (Mike Rubenstein)
- Newsgroups: comp.lang.c
- Subject: Re: extern func() declaration?
- Date: Fri, 19 Apr 1996 19:39:40 GMT
- Organization: Netcom
- Message-ID: <3177ea73.162423432@nntp.ix.netcom.com>
- References: <316436C5.413E@micromedia.on.ca> <4l67qu$drk@sun001.spd.dsccc.com> <4l7dod$a0k@nntp.Stanford.EDU>
- NNTP-Posting-Host: ix-dc19-07.ix.netcom.com
- X-NETCOM-Date: Fri Apr 19 2:38:11 PM CDT 1996
- X-Newsreader: Forte Agent .99d/32.182
-
- karish@pangea.Stanford.EDU (Chuck Karish) wrote:
-
- > In article <4l67qu$drk@sun001.spd.dsccc.com>,
- > Mike McCarty <jmccarty@sun1307.spd.dsccc.com> wrote:
- > >In article <316436C5.413E@micromedia.on.ca>,
- > >Richard Steadman <rsteadma@micromedia.on.ca> wrote:
- > >
- > >)What's the difference between
- > >)
- > >) extern int func(void);
- > >)
- > >)and
- > >)
- > >) int func(void);
- > >)
- > >)when declaring functions located in another source file?
- > >
- > >Pedantic differences aside, they mean -exactly- the same thing.
- >
- > One not-so-pedantic difference is that the declaration with
- > "extern" also works when the function is actually defined in
- > the same source module, while the one without is liable to cause
- > "multiply defined" error messages from the compiler.
-
- It's only likely to do that if it is not a C compiler. In C
-
- extern int func(void);
-
- and
-
- int func(void);
-
- are equivalent as Mike McCarthy wrote.
-
-
- Michael M Rubenstein
-